package com.ky.my.service.impl;




import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ky.my.Message;

import com.ky.common.vo.R;


import com.ky.my.mapper.MessageMapper;
import com.ky.my.service.MessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hmt
 * @since 2024-06-17
 */
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService {
    @Autowired
    private MessageMapper messageMapper;
    @Override
    public R findAllMassage(Message message) {
        //根据id查询消息
        QueryWrapper<Message> queryWrapper = new QueryWrapper<>(null);

        List<Message> messageList = messageMapper.selectList(queryWrapper);
        return R.ok(messageList);
    }

    @Override
    public R insertMassage(Message message) {
        int i = messageMapper.insert(message);
        return R.ok(i);
    }
}
